#pragma once

#include <interface/interface.h>

class voip_svc_impl;
class voip_driver;

class dll_object : public aot::tt::idll
{
public:
	dll_object(void);
public:
	virtual ~dll_object(void);
public:
	virtual bool query_interface(void** out, const char* key);
	virtual const char* interface_name() { return "idll.aot_voip.dll"; }
public:
	virtual const char* module_name() { return "aot_voip.dll"; }
	virtual bool on_regist(aot::tt::idll::dll_regist_param_t* p, aot::tt::result_t* ret = NULL);
public:
	bool query_interface_from_aot_inet_dll(void** out, int key);
private:
	void init_log(aot::tt::imain* imain_obj);
	void regist_sys_event(aot::tt::idll::dll_regist_param_t* p);
	int on_sys_event(int event_type, int ev, WPARAM wparam, LPARAM lparam, aot::tt::sys_event_param_t* sep);
public:
	aot::tt::iobj_auto_ptr<aot::tt::idll> aot_inet_dll_;
	aot::tt::imain* imain_;
	voip_svc_impl* voip_svc_impl_;
	bool plugins_reg_fini_;
};

extern dll_object* g_dll_obj;
voip_driver* get_voip_driver();

